﻿#ifndef _FITKCALCULIX_INP_READER_H___
#define _FITKCALCULIX_INP_READER_H___

#include "FITK_Interface/FITKInterfaceIO/FITKAbstractTextReader.h"
#include <QString>
#include <QHash>

namespace IO
{
    class InpKeyWordsChecker;
    /**
     * @brief CalculiX INP 文件读取器
     * @author libaojun
     * @date 2024-11-16
     */
    class FITKCalculiXINPReader : public Interface::FITKAbstractTextReader
    {
    public:
        explicit FITKCalculiXINPReader();
        virtual ~FITKCalculiXINPReader();

        void run() override;

        /**
         * @brief 读取一行数据
         * @return 一行数据
         * @author fulipeng (fulipengqd@yeah.net)
         * @date 2024-03-15
         */
        virtual QString readLine() override;
        /**
         * @brief 打印控制台消息
         * @param[i] level 打印级别 1 normal 2 warning 3error
         * @param[i] str 数据
         * @author libaojun (libaojunqd@Efoxmail.com)
         * @date 2024-11-16
         */
        void consoleMessage(int level, const QString& str) override;

        bool checkKeyWords(const QString& header, const QStringList& keys, const QHash<QString, QString>& keyValues);

    private:

        /**
         * @brief 关键字检查器
         * @author LiBaojun (libaojunqd@foxmail.com)
         * @date 2024-03-19
         */
        InpKeyWordsChecker* _keyWordsChecker{};
    };
}


#endif
